package com.juyu.miliao.api.dao.mysql;

import org.apache.ibatis.session.SqlSession;
import org.springframework.stereotype.Repository;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@Repository
public class HostLineDao {
    @Resource
    private SqlSession sqlSession;

    /**
     *
     * @param userId
     * @param eventType 1:登录事件 2：登出事件
     * @param nowTime 云信同步事件时间
     * @return
     */
    public int insertHostLine(long userId, int eventType, String nowTime){
        Map<String, Object> params = new HashMap<>();
        params.put("userId", userId);
        params.put("eventType", eventType);
        params.put("nowTime", nowTime);
        return sqlSession.insert("insertHostLine", params);
    }
}

